<?php include("head.php"); 
    include("conn.php");
    //需要对kid做一个验证
    $kid = empty($_GET["kid"])?"null":$_GET["kid"];
    if($kid=="null"){
        die("请输入正确的参数！");
    }
	//执行查询sql
    $sql = "select 班号,班长,教室,班主任,班级口号 from `班级` where 班号='{$kid}'";
    $result = mysqli_query($conn,$sql);
    if( mysqli_num_rows($result)>0 ){
		//转成关联数组，因为这里确定只有一条记录，所以不用while循环
		$arr = mysqli_fetch_assoc($result);
    }else{
        echo "找不到这条记录";
    }
?>
    <div class="sui-layout">
		  <div class="sidebar">
<?php include("leftmenu.php"); ?>	  	
		  </div>
		  <div class="content">
          <p class="sui-text-xxlarge my-padd">班级信息录入</p>
			<form action="banji_save.php" method="get" class="sui-form form-horizontal sui-validate">
                <input type="hidden" name="action" value="update">
			  <div class="control-group">
			    <label for="kcName" class="control-label">班号：</label>
			    <div class="controls">
			      <input name="banhao" type="text" id="banhao" class="input-large input-fat" placeholder="输入班号" data-rules="required|minlength=2|maxlength=10" value="<?php echo $arr['班号'] ?>">
			    </div>
			  </div>
			  <div class="control-group">
			    <label for="inputEmail" class="control-label">班长：</label>
			    <div class="controls">
			      <input name="banzhang" type="text" id="banzhang" class="input-large input-fat"  placeholder="输入班长姓名" data-rules="required|minlength=2|maxlength=10" value="<?php echo $arr['班长'] ?>">
			    </div>
			  </div>
			  <div class="control-group">
			    <label for="jiaoshi" class="control-label">教室：</label>
			    <div class="controls">
			      <input name="jiaoshi" type="text" id="jiaoshi" class="input-large input-fat"  placeholder="输入教室" data-rules="required|minlength=2|maxlength=10" value="<?php echo $arr['教室'] ?>">
			    </div>
			  </div>
			  <div class="control-group">
			    <label for="banzhuren" class="control-label">班主任：</label>
			    <div class="controls">
			      <input name="banzhuren" type="text" id="banzhuren" class="input-large input-fat"  placeholder="输入班主任姓名" data-rules="required|minlength=2|maxlength=10" value="<?php echo $arr['班主任'] ?>">
			    </div>
			  </div>
			  <div class="control-group">
			    <label for="banzhuren" class="control-label">班级口号：</label>
			    <div class="controls">
			      <input name="kouhao" type="text" id="banzhuren" class="input-large input-fat"  placeholder="输入班级口号" data-rules="required|minlength=2|maxlength=20" value="<?php echo $arr['班级口号'] ?>">
			    </div>
			  </div>				  
			  <div class="control-group">
			  	<label class="control-label"></label>
			  	<div class="controls">
			  		<input type="submit" value="修改" name="" class="sui-btn btn-large btn-primary">
			  	</div>
			  </div>	  
			</form>
		  </div>
		</div>		
    </div>
<?php include("foot.php"); ?>